<?php
// +----------------------------
// | Created by PhpStorm
// +----------------------------
// | Author: YnnSon
// +----------------------------
namespace app\api\controller\v1;

use app\api\service\Covid as CovidService;
use app\api\validate\CovidValidate;
use think\Request;

/**
 * 疫情信息接口
 * Class Covid
 * @package app\api\controller\v1
 */
class Covid
{
    /**
     * @Desc 获取全国疫情信息
     * @return array
     */
    public function getChinaData()
    {
        return CovidService::getChinaData();
    }

    /**
     * @Desc 获取省市疫情信息
     * @return array
     */
    public function getAreaData()
    {
        (new CovidValidate())->goCheck();
        $param = Request::instance()->get();
        return CovidService::getAreaData($param);
    }
}